package com.keyancompany.zhongbaopingtai.ui;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.keyancompany.zhongbaopingtai.R;


public class LoadingNoCancelDialog extends BaseDialog {

    private TextView textView;

    private int targetX, targetY;

    public LoadingNoCancelDialog(Context context) {
        super(context, R.style.NoCancelDialogStyle);
//        this.targetY = ScreenUtils.getScreenHeight(context) / 2;
//        this.targetX = ScreenUtils.getScreenWidth(context) / 2;
    }


//    public void setTargetLocation(int x, int y) {
//        if (x != 0)
//            this.targetX = x;
//        if (y != 0)
//            this.targetY = y;
//    }


    public LoadingNoCancelDialog(Context context, int theme) {
        super(context, theme);
    }

    @Override
    public void setUpViews() {
        LinearLayout layout = (LinearLayout) convertView
                .findViewById(R.id.dialog_view);// 加载布局
        layout.setLayoutParams(new FrameLayout.LayoutParams(150, 150));
        textView = (TextView) layout.findViewById(R.id.progressbar_text);
        textView.setText(R.string.watting_hint);
        textView.setVisibility(View.GONE);
//        setLayouParams(100, 100, targetX, targetY);
        setCanceledOnTouchOutside(false);
    }

    public void setPromptTxt(int stringId) {
        textView.setText(stringId);
    }

    @Override
    LayoutParams getILayoutParams() {
        LayoutParams lp = new LayoutParams(150, 150);
        return lp;
    }

    @Override
    public int getContentView() {
        return R.layout.dialog_loading;
    }

    @Override
    public int getDialogWidth() {
        return 0;
    }

    @Override
    public int getDialogHeight() {
        return 0;
    }

    @Override
    public int getContentGravity() {
        // TODO Auto-generated method stub
        return 0;
    }

}
